package com.jrx.anytxn.customer.dto.creditinfo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
 * 额度调整的请求报文集合对应对象
 * @author Qingyao Xing
 * @date 2019/8/16 16:59
 */
public class CreditAdjustInfoReq implements Serializable {

    private static final long serialVersionUID = -2931900325334557704L;
    /**
     * 产品ID
     */
    @NotBlank(message = "产品ID不能为空")
    @ApiModelProperty(value="产品ID",example="P5562")
    @Size(max = 32,message = "productId长度不能大于32位字符")
    private String productId;

    /**
     * 合同号
     */
    @ApiModelProperty(value="合同号")
    @Size(max = 32,message = "contractNumber长度不能大于32位字符")
    private String contractNumber;

    /**
     * 授信金额
     */
    @ApiModelProperty(value="授信金额",example="3000.00",dataType="BigDecimal")
    @DecimalMin(value ="0", message = "额度调整请求中授信金额不能小于0")
    private BigDecimal creditLimit;

    /**
     * 额度生效日期
     */
    @ApiModelProperty(value="额度生效日期",example="2019-09-03")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date effectiveDate;

    /**
     * 额度失效日期
     */
    @ApiModelProperty(value="额度失效日期",example="2020-10-09")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Future(message = "额度调整时额度失效日期需要大于当前时间")
    private Date expiryDate;

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getContractNumber() {
        return contractNumber;
    }

    public void setContractNumber(String contractNumber) {
        this.contractNumber = contractNumber;
    }

    public BigDecimal getCreditLimit() {
        return creditLimit;
    }

    public void setCreditLimit(BigDecimal creditLimit) {
        this.creditLimit = creditLimit;
    }

    public Date getEffectiveDate() {
        return effectiveDate;
    }

    public void setEffectiveDate(Date effectiveDate) {
        this.effectiveDate = effectiveDate;
    }

    public Date getExpiryDate() {
        return expiryDate;
    }

    public void setExpiryDate(Date expiryDate) {
        this.expiryDate = expiryDate;
    }

    @Override
    public String toString() {
        return "CreditInfo{" +
                "productId='" + productId + '\'' +
                ", contractNumber='" + contractNumber + '\'' +
                ", creditLimit=" + creditLimit +
                ", effectiveDate=" + effectiveDate +
                ", expiryDate=" + expiryDate +
                '}';
    }
}
